package com.mjfeed.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @description 发货项 
 * @author zhaominglei
 * @date 2014年10月20日
 */
@Entity
@Table(name="feed_shipping_item")
public class ShippingItem extends BaseEntity {
	private static final long serialVersionUID = 1232794825673834521L;

	/** 商品名称 */
	private String name;

	/** 数量 */
	private Integer quantity;
	
	/** 商品编号 */
	private String sn;

	/** 发货单 */
	private Shipping shipping;
	
	/** 商品 */
	private Product product;

	@Column(nullable=false, updatable=false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(nullable=false, updatable=false)
	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	@Column(nullable=false, updatable=false)
	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="shipping_id", nullable=false, updatable=false)
	public Shipping getShipping() {
		return shipping;
	}

	public void setShipping(Shipping shipping) {
		this.shipping = shipping;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="product_id", nullable=false, updatable=false)
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}
}
